package cn.com.wxd.service.sms;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.com.wxd.common.file.ReadConfigFile;

/**
 * Title:短信信息工具
 * Description:cn.com.wxd.util.service.sms
 * <p>
 * Company: Amumu管理平台
 * Copyright: Copyright (c) 2015
 * All right reserved.
 * Created time: 2016-4-8 下午12:11:00
 *
 * @author WangXuDongs
 * @version 1.0
 */
public class SmsInfo {

    private static final Logger log = LoggerFactory.getLogger(SmsInfo.class);

    private static transient String userName;
    private static transient String password;
    private static String defaultService;
    private static int smsBalance = 0;

    static {
        init();
    }

    public static void init() {
        Map<String, String> conf = ReadConfigFile.readPropertiesConfig("wxd.sms");
        defaultService = conf.get("DefaultService");
        if (defaultService != null && !defaultService.equals("") && !defaultService.equals("Webchinese")) {
            userName = conf.get("Chuanglan.userName");
            password = conf.get("Chuanglan.passWord");
        } else {
            userName = conf.get("Webchinese.uid");
            password = conf.get("Webchinese.key");
        }
        log.debug(defaultService+userName+password);
    }

    public static String getDefaultService() {
        return defaultService;
    }

    public static String getUserName() {
        return userName;
    }

    public static void setUserName(String userName) {
        SmsInfo.userName = userName;
    }

    public static String getPassword() {
        return password;
    }

    public static void setPassword(String password) {
        SmsInfo.password = password;
    }

    public static void setDefaultService(String defaultService) {
        SmsInfo.defaultService = defaultService;
    }

    public static int getSmsBalance() {
        return smsBalance;
    }

    public static void setSmsBalance(int smsBalance) {
        SmsInfo.smsBalance = smsBalance;
    }
}
